<?php
class Registry_Item
{
	static private $instance = null;
	private $collection;
			
	private function __construct()
	{
	}
	private function __clone()
	{
	}
	static public function getInstance()
	{
		if (self::$instance == null)
        {
            self::$instance = new self();
        }
        return self::$instance;
	}
	public function add($name, $item)
	{
		if (!isset($this->collection[$name]))
      	{
        	$this->collection[$name] = $item;
           	return true;
      	} else
      return false;
	}
	public function rm($name)
	{
		if (isset($this->collection[$name])) 
      	{
        	unset($this->collection[$name]);
        	return true;
      	} else
      return false;
	}
	public function getItem($name)
	{
		if (isset($this->collection[$name]))
			return $this->collection[$name];
		else
			return false;	
	}
	public function clean()
	{
		$this->collection = null;
	}
	/*public function setContext($context="root")
	{
		$this->context = $context;
	}*/
}
?>